<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/dute_favicon_32x32.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/dute_favicon_16x16.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">
  <link rel="manifest" href="/images/manifest.json">
  <meta name="msapplication-config" content="/images/browserconfig.xml">
  <meta http-equiv="Cache-Control" content="no-transform">
  <meta http-equiv="Cache-Control" content="no-siteapp">
  <meta name="google-site-verification" content="mpI5dkydstZXl6UcDCppqktXK0bbvqdZ6LkZ3KNk4Iw">
  <meta name="baidu-site-verification" content="code-a1LksZX2Ds">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">
  <link rel="stylesheet" href="//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"whitestore.top","root":"/","scheme":"Gemini","version":"7.8.0","exturl":true,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":true,"scrollpercent":true},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":true,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="&#x2F;dev&#x2F;shm使用和实现">
<meta property="og:type" content="article">
<meta property="og:title" content="【Linux】What Is dev shm And Its Practical Usage">
<meta property="og:url" content="https://whitestore.top/2023/07/27/devshmread/index.html">
<meta property="og:site_name" content="爱看书的阿东">
<meta property="og:description" content="&#x2F;dev&#x2F;shm使用和实现">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2023-07-27T03:21:58.000Z">
<meta property="article:modified_time" content="2023-09-09T00:53:49.936Z">
<meta property="article:author" content="阿东">
<meta property="article:tag" content="&#x2F;dev&#x2F;shm特殊">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://whitestore.top/2023/07/27/devshmread/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>【Linux】What Is dev shm And Its Practical Usage | 爱看书的阿东</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

<link rel="alternate" href="/atom.xml" title="爱看书的阿东" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">爱看书的阿东</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">赐他一块白色石头，石头上写着新名</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
        <li class="menu-item menu-item-sitemap">

    <a href="/sitemap.xml" rel="section"><i class="fa fa-fw fa-sitemap"></i>站点地图</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    

  <span class="exturl github-corner" data-url="aHR0cHM6Ly9naXRodWIuY29tL2xhenlUaW1lcw==" title="Follow me on GitHub" aria-label="Follow me on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></span>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://whitestore.top/2023/07/27/devshmread/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="阿东">
      <meta itemprop="description" content="随遇而安">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="爱看书的阿东">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          【Linux】What Is dev shm And Its Practical Usage
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2023-07-27 11:21:58" itemprop="dateCreated datePublished" datetime="2023-07-27T11:21:58+08:00">2023-07-27</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2023-09-09 08:53:49" itemprop="dateModified" datetime="2023-09-09T08:53:49+08:00">2023-09-09</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Linux/" itemprop="url" rel="index"><span itemprop="name">Linux</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2023/07/27/devshmread/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2023/07/27/devshmread/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="fa fa-file-word-o"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>4.6k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="fa fa-clock-o"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>4 分钟</span>
            </span>
            <div class="post-description">/dev/shm使用和实现</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h1 id="原文"><a href="#原文" class="headerlink" title="原文"></a>原文</h1><p><span class="exturl" data-url="aHR0cHM6Ly93d3cuY3liZXJjaXRpLmJpei90aXBzL3doYXQtaXMtZGV2c2htLWFuZC1pdHMtcHJhY3RpY2FsLXVzYWdlLmh0bWw=" title="https://www.cyberciti.biz/tips/what-is-devshm-and-its-practical-usage.html">What Is /dev/shm And Its Practical Usage - nixCraft (cyberciti.biz)<i class="fa fa-external-link"></i></span></p>
<a id="more"></a>

<h1 id="介绍"><a href="#介绍" class="headerlink" title="介绍"></a>介绍</h1><p><strong>/dev/shm</strong> is nothing but implementation of traditional <strong>shared memory</strong> concept. </p>
<p><strong>/dev/shm</strong>只不过是传统<strong>共享内存</strong>概念的实现。</p>
<p>It is an efficient means of passing data between programs.</p>
<p>它是一种在程序间传递数据的有效方法。</p>
<p>One program will create a memory portion, which other processes (if permitted) can access.</p>
<p>一个程序将创建一个内存部分，其他进程（如果允许）可以访问该部分。</p>
<p>This will result into speeding up things on Linux.  </p>
<p>这将（意味着）加快 Linux 的运行速度。 </p>
<p>shm / shmfs is also known as tmpfs, which is a common name for a temporary file storage facility on many Unix-like operating systems. </p>
<p><code>shm / shmfs</code> 也称为 <code>tmpfs</code>，是许多类 <code>Unix</code> 操作系统中临时文件存储设备的通用名称。</p>
<p>It is intended to appear as a mounted file system, but one which uses virtual memory instead of a persistent storage device.</p>
<p><code>tmpfs</code> 的内容是显示已加载的文件系统、但是<strong>使用的是用户虚拟内存而不是一个永久存储设备</strong>。</p>
<p>If you type the mount command you will see /dev/shm as a tempfs file system. </p>
<p>如果键入挂载命令，就会看到 <code>/dev/shm</code> 作为 <code>tempfs</code> 文件系统。</p>
<p>Therefore, it is a file system, which keeps all files in virtual memory. </p>
<p>因此，（<code>/dev/shm</code>）<strong>它是一个将所有文件保存在虚拟内存中的文件系统</strong>。</p>
<p>Everything in tmpfs is temporary in the sense that no files will be created on your hard drive.</p>
<p>注意，所有在<code>tmpfs</code>中发生的事情都是临时的，不会在硬盘上创建任何文件。</p>
<p>If you unmount a tmpfs instance, everything stored therein is lost. </p>
<p><strong>如果你卸载一个tmpfs 实例，它内部的所有存储内容都将丢失。</strong></p>
<p>By default almost all Linux distros configured to use /dev/shm:  </p>
<p>默认情况下，几乎所有 Linux 发行版都配置使用<code>/dev/shm</code>：</p>
<p>比如你使用下面的命令。</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ df -h</span><br></pre></td></tr></table></figure>

<p>Sample outputs:</p>
<p>输出示例</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">Filesystem            Size  Used Avail Use% Mounted on</span><br><span class="line">&#x2F;dev&#x2F;mapper&#x2F;wks01-root</span><br><span class="line">                      444G   70G  351G  17% &#x2F;</span><br><span class="line">tmpfs                 3.9G     0  3.9G   0% &#x2F;lib&#x2F;init&#x2F;rw</span><br><span class="line">udev                  3.9G  332K  3.9G   1% &#x2F;dev</span><br><span class="line">tmpfs                 3.9G  168K  3.9G   1% &#x2F;dev&#x2F;shm</span><br><span class="line">&#x2F;dev&#x2F;sda1             228M   32M  184M  15% &#x2F;boot</span><br></pre></td></tr></table></figure>

<h2 id="Nevertheless-where-can-I-use-dev-shm-但是，在哪里可以使用-dev-shm？"><a href="#Nevertheless-where-can-I-use-dev-shm-但是，在哪里可以使用-dev-shm？" class="headerlink" title="Nevertheless, where can I use /dev/shm? 但是，在哪里可以使用 /dev/shm？"></a>Nevertheless, where can I use /dev/shm? 但是，在哪里可以使用 /dev/shm？</h2><p>You can use /dev/shm to improve the performance of application software such as Oracle or overall Linux system performance.</p>
<p>您可以使用 /dev/shm 来提高 Oracle 等应用软件的性能或 Linux 系统的整体性能。</p>
<p>On heavily loaded system, it can make tons of difference. </p>
<p>在负载较重的系统中，它可以产生巨大的差异。</p>
<p>For example VMware workstation/server can be optimized to improve your Linux host’s performance (i.e. improve the performance of your virtual machines).</p>
<p>例如，可以对 VMware 工作站/服务器进行优化，以提高 Linux 主机的性能（即提高虚拟机的性能）。</p>
<p>In this example, remount /dev/shm with 8G size as follows:</p>
<p>比如下面这个例子，重新挂载 8G 大小的 /dev/shm，如下所示：</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mount -o remount,size=8G /dev/shm</span><br></pre></td></tr></table></figure>

<p>To be frank, if you have more than 2GB RAM + multiple Virtual machines, this hack always improves performance. </p>
<p>坦率地说，<strong>如果你有超过 2GB 内存和多个虚拟机，这个黑客程序总能提高性能。</strong></p>
<p>In this example, you will give you tmpfs instance on /disk2/tmpfs which can allocate 5GB RAM/SWAP in 5K inodes and it is only accessible by root:</p>
<p>在本例中，你将在 <code>/disk2/tmpfs</code> 上创建一个 tmpfs 实例，它可以在 5K inodes 中分配 5GB RAM/SWAP，并且只能由 root 访问：</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mount -t tmpfs -o size=5G,nr_inodes=5k,mode=700 tmpfs /disk2/tmpfs</span><br></pre></td></tr></table></figure>

<p>Where,</p>
<p>命令解释：</p>
<ul>
<li><p><strong>-o opt1,opt2</strong> : Pass various options with a -o flag followed by a comma separated string of options. In this examples, I used the following options:</p>
</li>
<li><p><strong>-o opt1,opt2</strong> ： 使用 -o 标志传递各种选项，后跟逗号分隔的选项字符串。在本例中，我使用了以下选项：</p>
<ul>
<li><p><strong>remount</strong> : Attempt to remount an already-mounted filesystem. In this example, remount the system and increase its size.</p>
</li>
<li><p><strong>remount</strong> : 尝试重新挂载已挂载的文件系统。在此示例中，重新挂载系统并增大其大小。</p>
</li>
<li><p><strong>size=8G or size=5G</strong> : Override default maximum size of the /dev/shm filesystem. he size is given in bytes, and rounded up to entire pages.<br>覆盖 /dev/shm 文件系统的默认最大大小。大小以字节为单位，四舍五入为整页。</p>
<p>The default is half of the memory.<br>  默认值为内存的一半。</p>
<p>The size parameter also accepts a suffix % to limit this tmpfs instance to that percentage of your pysical RAM: the default, when neither size nor nr_blocks is specified, is size=50%.<br>size 参数也接受后缀 %，用于将此 tmpfs 实例限制为实际内存的该百分比：<strong>当既未指定 size 也未指定 nr_blocks 时，默认值为 size=50%</strong>。</p>
<p>In this example it is set to 8GiB or 5GiB. The tmpfs mount options for sizing ( size, nr_blocks, and nr_inodes) accept a suffix k, m or g for Ki, Mi, Gi (binary kilo, mega and giga) and can be changed on remount.<br>在本例中，它被设置为 8GiB 或 5GiB。tmpfs 挂载选项的大小（size、nr_block 和 nr_inodes）接受 Ki、Mi、Gi（二进制千、兆和千兆）的后缀 k、m 或 g，并可在重新挂载时更改。</p>
</li>
<li><p><strong>nr_inodes=5k</strong> : </p>
</li>
<li><p>The maximum number of inodes for this instance. The default is half of the number of your physical RAM pages, or (on a machine with highmem) the number of lowmem RAM pages, whichever is the lower.<br>此实例的最大 inodes 数量。默认值是物理 RAM 页数的一半，或（在使用高内存的机器上）低内存 RAM 页数的一半，以较低者为准。</p>
</li>
<li><p><strong>mode=700</strong> : Set initial permissions of the root directory.<br>设置根目录的初始权限。</p>
</li>
<li><p><strong>tmpfs</strong> : Tmpfs is a file system which keeps all files in virtual memory.<br>Tmpfs 是一种将所有文件保存在虚拟内存中的文件系统。</p>
</li>
</ul>
</li>
</ul>
<h2 id="How-do-I-restrict-or-modify-size-of-dev-shm-permanently-如何永久限制或修改-dev-shm-的大小？"><a href="#How-do-I-restrict-or-modify-size-of-dev-shm-permanently-如何永久限制或修改-dev-shm-的大小？" class="headerlink" title="How do I restrict or modify size of /dev/shm permanently?如何永久限制或修改 /dev/shm 的大小？"></a>How do I restrict or modify size of /dev/shm permanently?如何永久限制或修改 /dev/shm 的大小？</h2><p>You need to add or modify entry in /etc/fstab file so that system can read it after the reboot. Edit, /etc/fstab as a root user, enter:  </p>
<p>您需要添加或修改 <code>/etc/fstab</code> 文件中的配置，以便系统能在重启后读取它。以根用户身份编辑 <code>/etc/fstab</code>，输入  </p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">vi /etc/fstab</span><br></pre></td></tr></table></figure>

<p>Append or modify <code>/dev/shm</code> entry as follows to set size to 8G</p>
<p>添加或修改 <code>/dev/shm</code> 条目如下，将大小设置为 8G</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">none      /dev/shm        tmpfs   defaults,size=8G        0 0</span><br></pre></td></tr></table></figure>

<p>Save and close the file. For the changes to take effect immediately remount /dev/shm:  </p>
<p>保存并关闭文件。要使更改立即生效，请重新挂载 <code>/dev/shm</code>：  </p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mount -o remount /dev/shm</span><br></pre></td></tr></table></figure>

<p>Verify the same:  </p>
<p>验证是否一致：</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">df -h</span><br></pre></td></tr></table></figure>

<h1 id="Recommend-readings"><a href="#Recommend-readings" class="headerlink" title="Recommend readings:"></a>Recommend readings:</h1><h1 id="推荐读物："><a href="#推荐读物：" class="headerlink" title="推荐读物："></a>推荐读物：</h1><ul>
<li><p>See man pages of mount regarding tmpfs options.</p>
</li>
<li><p>Details regarding tmpfs is available in <span class="exturl" data-url="aHR0cHM6Ly93d3cuY3liZXJjaXRpLmJpei9maWxlcy9saW51eC1rZXJuZWwvRG9jdW1lbnRhdGlvbi9maWxlc3lzdGVtcy90bXBmcy50eHQ=" title="https://www.cyberciti.biz/files/linux-kernel/Documentation/filesystems/tmpfs.txt">/usr/share/doc/kernel-doc-/Documentation/filesystems/tmpfs.txt<i class="fa fa-external-link"></i></span> file.</p>
</li>
<li><p>有关 tmpfs 选项，请参阅 mount 的手册。</p>
</li>
<li><p>有关 tmpfs 的详细信息，请参阅 <span class="exturl" data-url="aHR0cHM6Ly93d3cuY3liZXJjaXRpLmJpei9maWxlcy9saW51eC1rZXJuZWwvRG9jdW1lbnRhdGlvbi9maWxlc3lzdGVtcy90bXBmcy50eHQ=" title="https://www.cyberciti.biz/files/linux-kernel/Documentation/filesystems/tmpfs.txt">/usr/share/doc/kernel-doc-/Documentation/filesystems/tmpfs.txt<i class="fa fa-external-link"></i></span> 文件。</p>
</li>
</ul>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/kity@2.0.4/dist/kity.min.js"></script><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/kityminder-core@1.4.50/dist/kityminder.core.min.js"></script><script defer="true" type="text/javascript" src="https://cdn.jsdelivr.net/npm/hexo-simple-mindmap@0.2.0/dist/mindmap.min.js"></script><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/hexo-simple-mindmap@0.2.0/dist/mindmap.min.css">
    </div>

    
    
    
        

<div>
<ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者： </strong>lazytime
  </li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    <a href="https://whitestore.top/2023/07/27/devshmread/" title="【Linux】What Is dev shm And Its Practical Usage">https://whitestore.top/2023/07/27/devshmread/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <span class="exturl" data-url="aHR0cHM6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL2xpY2Vuc2VzL2J5LW5jLzQuMC96aC1DTg=="><i class="fa fa-fw fa-creative-commons"></i>BY-NC</span> 许可协议。转载请注明出处！
  </li>
</ul>
</div>


      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/Linux/" rel="tag"># Linux</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2023/07/16/doPrivileged/" rel="prev" title="【Java】关于 AccessController.doPrivileged 方法的个人理解">
      <i class="fa fa-chevron-left"></i> 【Java】关于 AccessController.doPrivileged 方法的个人理解
    </a></div>
      <div class="post-nav-item">
    <a href="/2023/07/27/sittingposition/" rel="next" title="【健康】你的坐姿真的正確嗎？">
      【健康】你的坐姿真的正確嗎？ <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#原文"><span class="nav-number">1.</span> <span class="nav-text">原文</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#介绍"><span class="nav-number">2.</span> <span class="nav-text">介绍</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#Nevertheless-where-can-I-use-dev-shm-但是，在哪里可以使用-dev-shm？"><span class="nav-number">2.1.</span> <span class="nav-text">Nevertheless, where can I use &#x2F;dev&#x2F;shm? 但是，在哪里可以使用 &#x2F;dev&#x2F;shm？</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#How-do-I-restrict-or-modify-size-of-dev-shm-permanently-如何永久限制或修改-dev-shm-的大小？"><span class="nav-number">2.2.</span> <span class="nav-text">How do I restrict or modify size of &#x2F;dev&#x2F;shm permanently?如何永久限制或修改 &#x2F;dev&#x2F;shm 的大小？</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#Recommend-readings"><span class="nav-number">3.</span> <span class="nav-text">Recommend readings:</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#推荐读物："><span class="nav-number">4.</span> <span class="nav-text">推荐读物：</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">阿东</p>
  <div class="site-description" itemprop="description">随遇而安</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">239</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">36</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">37</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL2xhenlUaW1lcw==" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;lazyTimes"><i class="fa fa-fw fa-github"></i>GitHub</span>
      </span>
      <span class="links-of-author-item">
        <span class="exturl" data-url="bWFpbHRvOjEwOTc0ODM1MDhAcXEuY29t" title="E-Mail → mailto:1097483508@qq.com"><i class="fa fa-fw fa-envelope"></i>E-Mail</span>
      </span>
  </div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title">
      <i class="fa fa-fw fa-link"></i>
      友情链接
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <span class="exturl" data-url="aHR0cHM6Ly93d3cuNTJwb2ppZS5jbi9ob21lLnBocD9tb2Q9c3BhY2UmdWlkPTE0OTc3MTgmZG89dGhyZWFkJnZpZXc9bWUmZnJvbT1zcGFjZQ==" title="https:&#x2F;&#x2F;www.52pojie.cn&#x2F;home.php?mod&#x3D;space&amp;uid&#x3D;1497718&amp;do&#x3D;thread&amp;view&#x3D;me&amp;from&#x3D;space">吾爱破解</span>
        </li>
        <li class="links-of-blogroll-item">
          <span class="exturl" data-url="aHR0cHM6Ly9qdWVqaW4uaW0vdXNlci8yOTk5MTIzNDUyNjI2MzY2" title="https:&#x2F;&#x2F;juejin.im&#x2F;user&#x2F;2999123452626366">掘金</span>
        </li>
        <li class="links-of-blogroll-item">
          <span class="exturl" data-url="aHR0cHM6Ly9zZWdtZW50ZmF1bHQuY29tL3UvbGF6eXRpbWVz" title="https:&#x2F;&#x2F;segmentfault.com&#x2F;u&#x2F;lazytimes">思否</span>
        </li>
    </ul>
  </div>

      </div>

      <div class="wechat_OA">
        <span>欢迎关注我的公众号</span>
        <br>
          <!-- 这里添加你的二维码图片 -->
        <img src ="https://adong-picture.oss-cn-shenzhen.aliyuncs.com/adong/wechat_channel.jpg">
      </div>
        <div class="back-to-top motion-element">
          <i class="fa fa-arrow-up"></i>
          <span>0%</span>
        </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2023</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">阿东</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-area-chart"></i>
    </span>
      <span class="post-meta-item-text">站点总字数：</span>
    <span title="站点总字数">2m</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span class="post-meta-item-text">站点阅读时长 &asymp;</span>
    <span title="站点阅读时长">29:50</span>
</div>
  <div class="powered-by">由 <span class="exturl theme-link" data-url="aHR0cHM6Ly9oZXhvLmlv">Hexo</span> & <span class="exturl theme-link" data-url="aHR0cHM6Ly90aGVtZS1uZXh0Lm9yZw==">NexT.Gemini</span> 强力驱动
  </div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
  <script src="//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : false,
      notify     : true,
      appId      : 'qMUpEEvBgXaMDD1b0ftgi9xr-gzGzoHsz',
      appKey     : 'UCdfT4Rfih6MO6y8DI4fstf6',
      placeholder: "Just go go",
      avatar     : 'mm',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : false,
      lang       : 'zh-CN' || 'zh-cn',
      path       : location.pathname,
      recordIP   : false,
      serverURLs : ''
    });
  }, window.Valine);
});
</script>

</body>
</html>
